package io;

import java.io.BufferedOutputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

/**
 * 说明:
 *
 * @author:SuZhongHe
 * @date:2023/3/8
 **/
public class FlushDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("fos.txt");
        BufferedOutputStream bos = new BufferedOutputStream(fos);
        String s = "好好学习天天向上";
        bos.write(s.getBytes(StandardCharsets.UTF_8));
        bos.flush();
        bos.close();
    }
}
